package com.project.myshop.services.impl;

import com.project.myshop.dao.UserDao;
import com.project.myshop.dao.impl.UserDaoImpl;
import com.project.myshop.entity.User;
import com.project.myshop.services.UserServices;
import com.project.myshop.util.StringUtils;

import java.sql.SQLException;

public class UserServicesImpl implements UserServices {
    private UserDao ud=new UserDaoImpl();
    @Override
    public User findUserByName(String username) {
        try {
            if (StringUtils.isNotEmpty(username)) {
                //访问dao查询数据
                return ud.findUserByName(username);
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return null;
    }
}
